/*
 * RoomPrinter.cpp
 *
 *  Created on: 30.10.2013
 *      Author: ulgish
 */

#include <lab3/RoomPrinter.h>
#include <lab3/Room.h>
#include <SyncWriter.h>
#include <unistd.h>
namespace DT {

RoomPrinter::RoomPrinter(){

}

int DT::RoomPrinter::delayInMs = 100;

void *RoomPrinter::run(void *arg)
{
	Room* room = (Room*) arg;
	room->print();
	while (room->isOpen()){
		usleep(MS(DT::RoomPrinter::delayInMs));
		room->print();
	}
	for (int i = 0; i < 20; i++){
		usleep(MS(DT::RoomPrinter::delayInMs));
		room->print();

	}
	return NULL;

}


RoomPrinter::~RoomPrinter() {

}

}
